:root {
  --font-family: "Alimama", --animate-duration: $transition-delay;
}

*,
.cursor-pointer {
  // 移动端点击有蓝色底
  -webkit-tap-highlight-color: transparent;
}
* {
  padding: 0;
  margin: 0;
  font-family: var(--font-family), AlibabaHealthFont2, AlimamaDaoLiTi, sans-serif;
  box-sizing: border-box;
  outline: none !important;
}
.h-100dvh {
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
}

a {
  text-decoration: none;
  // color: var(--el-text-color);
}

a:active,
a:focus,
a:valid,
a:active {
  background-color: none;
}

li {
  list-style: none;
}

span {
  line-height: 100%;
}
// 页面
html,
body {
  font-family: Alimama, Helvetica, sans-serif;
  -webkit-tap-highlight-color: transparent;
  background-color: #f4f5f7;
}
html.dark,
body.dark {
  background-color: #141414;
}
::selection {
  background-color: var(--el-color-primary);
  color: #f0f0f0;
}
.dark ::selection {
  background-color: var(--el-color-primary);
  color: #f0f0f0;
}

// 字体
@font-face {
  font-display: swap;
  font-family: Alimama;
  src: url("/font/Alimama.woff2") format("woff2");
}

// 全局滚动条
::-webkit-scrollbar {
  width: $scroll-bar-width;
  height: 0;
  background-color: transparent;
}

/* 定义滚动条轨道 内部
  内阴影+圆角 */
::-webkit-scrollbar-track {
  background-color: #fff;
}

.dark ::-webkit-scrollbar-track {
  background-color: #141414;
}

/* 定义滑块 内阴影+圆角 */
::-webkit-scrollbar-thumb {
  border-radius: 0.8rem;
  background-color: rgb(68, 68, 68);
}

.dark ::-webkit-scrollbar-thumb {
  border-radius: 0.8rem;
  background-color: rgba(85, 85, 85, 0.479);
}

// 关闭所有动画渐变保证变化的流畅
html.stop-transition {
  &,
  * {
    transition: none !important;
  }
}
html.stop-transition-all {
  &,
  * {
    transition: none !important;
    backdrop-filter: none !important;
    animation: none !important;
  }
}

// 夜间模式切换动画
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  transition: none !important;
  mix-blend-mode: normal;
}

/**  ------------------------------element-plus---------------------------------------  **/
// 文本折叠
.text-overflow-1 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.text-overflow-2 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.text-overflow-3 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.text-overflow-4 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.text-overflow-h {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: var(--h);
  -webkit-box-orient: vertical;
}

.text-overflow-5 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
// element-plus
// 消息确认框
.el-message-box {
  .el-message-box__btns {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0.4em 0 0.4em 0;

    .el-button {
      min-width: 42%;
      height: auto;
      margin: 0 auto;
    }
  }

  .el-message-box__header {
    font-size: 2em;
    text-align: center;
    letter-spacing: 0.1em;
  }

  .el-message-box__content {
    margin: 0.4em 0.5em;
    font-size: 1rem;
    opacity: 0.8;
  }

  .el-message-box__title {
    font-size: 1.1rem;
    font-weight: 600;
  }
}

// 单选钮
.el-radio-group {
  font-size: medium;

  .el-radio__inner {
    border-radius: 4px;
    transform: scale(1.1);
  }
}

// 按钮
.el-button {
  transition: $transition-delay;
}

// popper
.el-popper-init {
  padding: 2px 4px;
}

// 消息框
body .el-message {
  width: max-content;
  max-width: 94%;
  padding: 0.4rem 0.6rem;
  transform: translate(-50%, 0) !important;
  --at-apply: "text-14px rounded-2rem shadow-md";
  .el-message__content {
    --at-apply: "truncate text-12px mt-1px";
  }
}
/**  ------------------------------right-menu---------------------------------------  **/
.v-auth-disabled {
  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
  }
}

// el-box层级错误
.el-overlay.is-message-box {
  z-index: 3000 !important;
}
.el-message-box__header.show-close {
  padding-right: 0 !important;
}
.el-message {
  z-index: 3100 !important;
}

// el-menu
.el-menu.is-fold {
  .el-sub-menu.is-active {
    border: 1px dashed var(--el-color-primary) !important;
  }
}
.el-sub-menu.is-active {
  .el-sub-menu__title {
    color: var(--el-color-primary) !important;
  }
}
.el-menu.el-menu--popup {
  padding: 0.4rem;
  border-radius: 0;
  .el-menu-item {
    margin-top: 0.4rem;
    border-radius: calc(var(--el-popper-border-radius) / 2);
    border: 1px solid transparent;
    &:first-child {
      margin-top: 0 !important;
    }
    &:first-of-type {
      margin-top: 0 !important;
    }
    &:hover {
      border: 1px dashed var(--el-color-primary);
    }
    &.is-active {
      box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
      background-color: var(--el-color-primary);
      color: #fff !important;
      border-radius: calc(var(--el-popper-border-radius) / 2);
      &:hover {
        background-color: var(--el-color-primary) !important;
        color: #fff !important;
        border-radius: calc(var(--el-popper-border-radius) / 2);
      }
    }
  }
}

.el-image-viewer__wrapper:focus {
  animation: fade-in-anim 0.3s ease-in-out;
  .el-image-viewer__canvas {
    animation: fade-blur 0.2s ease-in-out;
  }
}

@keyframes fade-blur {
  0% {
    opacity: 0;
    filter: blur(1rem);
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
} 
@keyframes fade-in-anim {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
  
}
